package com.netstar.property;

import java.io.IOException;

import org.json.JSONException;

public abstract class StringProperty extends PrimitiveProperty {

	public abstract void set(Property obj, String val);

	public abstract String get(Property obj);

	public StringProperty() {
	}

	@Override
	public void copy(Property lhs, Property rhs) {
		set(lhs, get(rhs));
	}

	public void parse(Property obj, Object value) throws JSONException, IOException {
		if (value == null) {
			set(obj, null);
		} else {
			set(obj, value.toString());
		}
	}

}
